#@bootStrapLayout("商户管理信息界面-添加")
#define bootStrapMain()
<div class="container">
    #include("../../common/header.html")
    <div class="col-md-12">
        <ol class="breadcrumb">
            <li><a href="#">主页</a></li>
            <li class="active">添加</li>
            <li></li>
        </ol>
    </div>

    <div class="col-md-12" >
        <div class="col-md-6 col-md-offset-1">
            <form class="form-horizontal" id="submitForm">
                #include("product-form.html")
            </form>
        </div>
    </div>
</div>
#end


#define bootStrapCss()
<link rel="stylesheet"
      href="#(contextPath)/assets/lib/kindeditor/themes/default/default.css" />
<link rel="stylesheet"
      href="#(contextPath)/assets/lib/kindeditor/plugins/code/prettify.css" />

#end

#define bootStrapJs()
<script charset="utf-8" src="#(contextPath)/assets/lib/kindeditor/kindeditor-all-min.js"></script>
<script charset="utf-8" src="#(contextPath)/assets/lib/kindeditor/lang/zh-CN.js"></script>
<script charset="utf-8" src="#(contextPath)/assets/lib/kindeditor/plugins/code/prettify.js"></script>

    <script>
        #@kindEditorInit("product.content")
        
         $("#preview_muti").on('click',".del-pic",function(){
        	$(this).parent().remove();
        });
        
        
        $("#submitBtn").click(function(){
            var imgs = $("#preview_muti>.imgWrap>img").children();
            var imgArr = new Array();
            for(var i=0;i<imgs.length;i++){
                console.log(imgs[i].src);
                imgArr.push({url:imgs[i].src})
            }
            $("#img_muti_hidden").val(JSON.stringify(imgArr));
            
            $.ajax({
                "url":"#(contextPath)/travel/product/doAdd",
                "method":"post",
                "data":$("#submitForm").serialize(),
                "success":function (resp) {
                    if(resp.result){
                        layer.msg(resp.data);
                        window.location.reload();
                        }else{
                        layer.msg(resp.data);
                        }
                    }
                })
            })
        #@webUploaderInit()
        #@webUploaderMutiInit()
    </script>
#end
